package edu.whu.dao;

import edu.whu.entity.Product;
import edu.whu.entity.Supplier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface ProductRepository extends JpaRepository<Product,Integer>, JpaSpecificationExecutor<Product> {
    @Query("select s from t_supplier s\n" +
            "join t_pro p  on p.id=s.productId\n" +
            " where s.productId = :id")
    List<Supplier> selectSuppliers(int id);





}
